package com.baizhi.obj;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

/**
 * 用于反序列化的高级流
 */
public class ObjectInputStreamDemo {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        FileInputStream fis = new FileInputStream("./javase_io/Person.obj");
        ObjectInputStream ois = new ObjectInputStream(fis);

        /*
           Object  readObject() 反序列化的方法
         */
        Person p = (Person)ois.readObject();
        System.out.println(p);

        ois.close();
    }
}
